using Microsoft.Xna.Framework.Graphics;
using PhantomRealm.Content.Skies;
using PhantomRealm.Content.Skies.Overlays;
using ReLogic.Content;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace PhantomRealm
{
    public class PhantomRealm : Mod
    {
        public static Effect AuroraEffect;
        public static Texture2D Noise;
        public override void Load()
        {
            if (Main.netMode != NetmodeID.Server)
            {
                AuroraEffect = ModContent.Request<Effect>("PhantomRealm/Assets/Effects/Aurora", AssetRequestMode.ImmediateLoad).Value;
                Noise = ModContent.Request<Texture2D>("PhantomRealm/Assets/Textures/Noise", AssetRequestMode.ImmediateLoad).Value;
                SkyManager.Instance["PhantomRealm:AuroraSky"] = new AuroraSky();
                Filters.Scene["PhantomRealm:AuroraSky"] = new Filter(new ScreenShaderData("FilterMiniTower").UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryLow);
                Overlays.Scene["PhantomRealm:AuroraSky"] = new AuroraOverlay();
            }
        }
        public override void Unload()
        {
            AuroraEffect = null;
            Noise = null;
        }      
    }
}
